home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2052 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.2 KB  |  71 lines

  1. Path: deimos.rz.uni-osnabrueck.de!lindi
  2. From: Klaus-Peter Lisson <dklisson>
  3. Newsgroups: comp.lang.c++
  4. Subject: HELP! 2 Classes, one name - how to resolve conflict?
  5. Date: 15 Jan 1996 09:15:52 GMT
  6. Organization: Universitaet Osnabrueck
  7. Message-ID: <4dd608$gcc@deimos.rz.uni-osnabrueck.de>
  8. NNTP-Posting-Host: rudra.informatik.uni-osnabrueck.de
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.01 9000/730)
  13. X-URL: news:comp.lang.c++
  14.  
  15. Hi there,
  16.  
  17. QUESTION:
  18. Can I compile a programm that includes and needs two classes
  19. that are NAMED THE SAME ???
  20.  
  21.  
  22. DETAILS:
  23. I'm using MSVC++ 2.1 with the MFC. In detail, I'm using
  24. the MFC-Collection-Classes (template versions) like CList,
  25. CMap etc.
  26.  
  27. Now I want to include OO-Database-support with POET 3.0
  28. (an OODB-library), designed for use with the MSVC++.
  29.  
  30. But, SLIGHT PROBLEM:
  31. #include <afxtempl.h>           // for MFC-CList/CMap etc.
  32. #include <poet.h>               // for OODB-support
  33. results in "class CList has already been defined"
  34.  
  35. Internally, the OODB uses a self-defined class CList, which
  36. is exactly named the same as the MFC-Class.
  37.         POET.h                          MFC (afxtmpl.h)
  38.         class CList {..}                class CList<...> {..}
  39.  
  40. E-mailing the POET-support, i got a friendly reply but no real
  41. help: ".. this conflict in names will be fixed in the next
  42. release..." - no practicable workaround could be offered.
  43.  
  44. So my question:
  45. Is there a chance in resolving such a naming conflict?
  46. I've some classes that use POET, some that use MFC, but none
  47. uses both at the same time...! Only my main-loop includes some
  48. of the POET-derived classes and some of "my" MFC-Classes.
  49. Particularly, I think of first compiling the classes that use POET
  50. then compiling my MFC-Classes and my "main"-programm, in the end
  51. linking all the obj-files.
  52. My hope is that in the obj-files, no names will be stored
  53. that could conflict with each other..?
  54.  
  55. In short:
  56. Can I compile a programm that includes one class twice (in 2 versions)
  57. and if so, how..??
  58.  
  59. And in general, (compiler experts adressed): When does a compiler
  60. "forget" about sourcecode-names and starts using memory adresses etc.?
  61.  
  62. Any comments welcome.
  63.  
  64. TIA,
  65.  
  66.  
  67.  
  68. Klaus-Peter Lisson
  69. dklisson@kali.informatik.uni-osnabrueck.de
  70.  
  71.